//
//  NSString+Time.m
//  TestApplication
//
//  Created by Hanlingyu on 16/9/24.
//  Copyright © 2016年 ltq. All rights reserved.
//

#import "NSString+Time.h"

@implementation NSString (Time)

+ (NSString *)convertTime:(CGFloat)length{
    NSDate *data = [NSDate dateWithTimeIntervalSince1970:length];
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    if (length / 3600 >= 1) {
        [formatter setDateFormat:@"HH:mm:ss"];
    } else {
        [formatter setDateFormat:@"mm:ss"];
    }
    NSString *showtimeNew = [formatter stringFromDate:data];
    return showtimeNew;
}

@end
